1. Technical Field
The present invention relates in general to object-oriented computer systems. More specifically, the present invention relates to the field of Java object-oriented systems.
2. Background Art
The development of the EDVAC computer system of 1948 is often cited as the beginning of the computer era. Since that time, computer systems have evolved into extremely sophisticated devices that may be found in many different settings. Computer systems typically include a combination of hardware (e.g., semiconductors, circuit boards, etc.) and software (e.g., computer programs). As advances in semiconductor processing and computer architecture push the performance of the computer hardware higher, more sophisticated computer software has evolved to take advantage of the higher performance of the hardware, resulting in computer systems today that are much more powerful than just a few years ago.
Object-oriented programming based on an object model is a new way of creating computer programs that has become very popular over the past several years. The goal of using object-oriented programming is to create small, reusable sections of program code known as objects that can be quickly and easily combined and re-used to create new programs. By creating and re-using a group of well-tested objects, a more stable, uniform, and consistent approach to developing new computer programs can be achieved.
Java is a modern object-oriented programming language specially designed to create distributed object systems. Java offers many features and advantages that makes it a desirable programming language to use. First, Java is specifically designed to create small programs, commonly called applets, that can reside on the network in centralized servers, and delivered to the client machine only when needed. Second, Java is completely platform independent. A Java program can be written once and ran on any type of platform that contains a Java Virtual Machine (JVM). And third, Java is an object-oriented language, meaning that software written in Java can take advantage of the benefits of object-oriented programming.
One issue in object oriented programming, and Java programing in particular, is object persistence. Persistent objects, as opposed to transient objects, have a lifetime that transcends the lifetime of the program that created them. To make an object persistent, mechanisms must be put in place to allow the object to survive the process that creates it so it can be accessed by other processes.
One common approach to providing persistence is the use of a persistent mixin class of objects. In this approach all objects for which persistence is desired must have this persistent mixin class as a superclass somewhere in their class""s inheritance lattice. Because a mixin class is required in the inheritance lattice, this method for providing object persistence cannot be used to provide persistence in a way that is orthogonal (i.e., independent) to the class of the object. Because the object persistence is not orthogonal to its class, the applications in which it can be used are limited.
Another approach which provides object persistence is xe2x80x9cexternalizationxe2x80x9d. Externalization is the means or protocol used in object-oriented programming for transferring data out of an object. In essence the xe2x80x9cstate dataxe2x80x9d that defines the attributes of an object are xe2x80x9cexternalizedxe2x80x9d, or written out of the object into a local data store in a format compatible with the local data store. When the object is needed again, the externalized state data is internalized into an object, creating an exact copy of the object as it previously existed. Unfortunately, the process of externalizing the state data for storage and then internalizing it again when needed takes an excessive amount of processing time and thus slows performance in a way that can be unacceptable in many applications.
As the use of the Java programming language increases, the need for a persistent object mechanism that works becomes more apparent. Without a mechanism that can be used to efficiently provide persistent objects in a Java programming environment, the computer industry will never fully realize the potential of the Java language.
According to the present invention, a method and apparatus for providing persistence to programming languages that do not have their own persistence storage systems, such as Java, is provided. The preferred method and apparatus utilize a Java object persistence mechanism to provide object persistence in way that can be adapted for use in a wide variety of situations. In the preferred embodiment, the Java object persistence mechanism is implemented by defining a StoragePlugin class of objects. The class of objects includes the methods needed to provide orthogonal persistence in the Java environment. StoragePlugin objects are then instantiated as needed from the StoragePlugin class. Each StoragePlugin object implements the defined methods in a way that is compatible with a particular persistent storage system that is to be used (i.e., a particular hardware and database system).